<template>
    <n-tag class="quick-item" size="small" @click="showPopover = !showPopover">配置本地用户</n-tag>
    <div id="com_QS_local_modal" class="quick-item-modal-card quick-item-modal-nomodal">
        <n-modal
            to="#com_QS_local_modal"
            v-model:show="showPopover"
            :mask-closable="false"
            title="参考配置"
            preset="card"
            draggable
            :trap-focus="false"
            :style="{ maxWidth: '600px' }">
            <div  >
                <n-code class="quick-code" language="js" :code="data"  />
            </div>
        </n-modal>
    </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const showPopover = ref(false)
const data = `
# 启用本地用户登录
local_enable=YES
write_enable=YES
local_umask=022

# 限制用户到自己的目录（不能串门）
chroot_local_user=YES
allow_writeable_chroot=YES

# 设置用户根目录为 /mnt/disk1/用户名
user_sub_token=$USER
local_root=/mnt/disk1/$USER

# 禁用匿名用户（稍后单独配置）
anonymous_enable=NO
`
</script>

<style lang="scss">
@use './quick-item.scss';
</style>
